class FLAT_CONTROLS

inherit
	IUP_INTERFACE

create {ANY}
   make

feature {ANY}
   make
      local
 			gui: IUP
			i: STRING
			a, b, c, d: ARRAY[IUP_WIDGET]
			ff: IUP_FLAT_FRAME
			ft: IUP_FLAT_TABS
			f1, f2, f3, f4, f5, f6, f7, f8: IUP_FLAT_BUTTON
			ftg: IUP_FLAT_TOGGLE
			scroll: IUP_FLAT_SCROLL_BOX
			v: IUP_VBOX
			h1, h2: IUP_HBOX
			sep: IUP_FLAT_SEPARATOR
			w: IUP_DIALOG

      do
			gui := iup_open
			
			create f1.flat_button("Flat button 1")
			f1.set_cb_flat_action(agent close)
			f1.set_padding(5, 3)
			f1.set_border(True)

			create f2.flat_button("Flat button 2")
			f2.set_cb_flat_action(agent close)
			f2.set_padding(5, 3)
			f2.set_border(True)

			create f3.flat_button("Flat button 3")
			f3.set_cb_flat_action(agent close)
			f3.set_padding(5, 3)
			f3.set_border(True)

			create f4.flat_button("Flat button 4")
			f4.set_cb_flat_action(agent close)
			f4.set_padding(5, 3)
			f4.set_border(True)

			create f5.flat_button("Flat button 5")
			f5.set_cb_flat_action(agent close)
			f5.set_padding(5, 3)
			f5.set_border(True)

			create f6.flat_button("Flat button 6 to test a flat scroll box at eiffel-iup")
			f6.set_cb_flat_action(agent close)
			f6.set_padding(5, 3)
			f6.set_border(True)

			create f7.flat_button("Flat button 7 to test a flat scroll box at eiffel-iup")
			f7.set_cb_flat_action(agent close)
			f7.set_padding(5, 3)
			f7.set_border(True)

			create f8.flat_button("Flat button 8 to test a flat scroll box at eiffel-iup")
			f8.set_cb_flat_action(agent close)
			f8.set_padding(5, 3)
			f8.set_border(True)

			create ftg.flat_toggle("Option")

			a := {ARRAY[IUP_WIDGET]} << f4, f5, ftg >>
			
			create h1.hbox(a)
			create ff.flat_frame(h1)
			ff.set_title("A flat frame")
			
			b := {ARRAY[IUP_WIDGET]} << f1, f2, f3, ff >>

			create ft.flat_tabs(b)
			ft.set_tab_n_title("One", 0)
			ft.set_tab_n_title("Two", 1)
			ft.set_tab_n_title("Three", 2)
			ft.set_tab_n_title("Four", 3)
			ft.set_size(250, 250)

			c := {ARRAY[IUP_WIDGET]} << f6, f7, f8 >>

			create h2.hbox(c)

			create scroll.flat_scroll_box(h2)
			scroll.set_size(5, 5)

			create sep.flat_separator
			sep.set_horizontal_orientation
			sep.set_style_fill
			sep.set_rgb_color(0, 200, 0)

			d := {ARRAY[IUP_WIDGET]} << ft, sep, scroll >>

	      create v.vbox(d)
			
	      create w.dialog(v)
			w.set_title("Flat controls and containers")
			w.set_predefined_size("HALF", "HALF")
	      i := w.show

         gui.main_loop
			gui.close
      end

	close (widget: IUP_FLAT_BUTTON): STRING
		do
			io.put_string("Executed %N")
			Result := "IUP_CLOSE"
		end

end -- class FLAT_CONTROLS
